package gozerocommon

import (
	"fmt"
	"strings"
)

func Placeholders(n int) string {
	var b strings.Builder
	for i := 0; i < n-1; i++ {
		b.WriteString(fmt.Sprintf("$%d,", i+1))
	}
	if n > 0 {
		b.WriteString(fmt.Sprintf("$%d", n))
	}
	return b.String()
}

func Int64SliceToInterface(ids []int64) []interface{} {
	newIds := make([]interface{}, 0)
	for _, item := range ids {
		newIds = append(newIds, item)
	}
	return newIds
}
